package hud;

import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;

public class Menu {
    public static MenuBar create() {
        MenuBar menuBar = new MenuBar();
        javafx.scene.control.Menu menuFile = new javafx.scene.control.Menu("File");
        MenuItem add = new MenuItem("Connect");
        add.setOnAction(new EventHandler<ActionEvent>() {
            public void handle(ActionEvent event) {
                System.out.println("menu click");
            }
        });
        menuFile.getItems().addAll(add);

        javafx.scene.control.Menu menuEdit = new javafx.scene.control.Menu("Edit");
        javafx.scene.control.Menu menuView = new javafx.scene.control.Menu("View");
        menuBar.getMenus().addAll(menuFile, menuEdit, menuView);

        return menuBar;
    }
}